const fs = require('fs');
const pool = require('../config/db');

async function runMigration() {
  try {
    // Read the SQL file
    const sql = fs.readFileSync('./migrations/update_merchant_applications.sql', 'utf8');
    
    console.log('Connected to database');
    
    // Execute the SQL
    console.log('Running migration...');
    await pool.query(sql);
    
    console.log('Migration completed successfully');
    
  } catch (error) {
    console.error('Error running migration:', error);
    process.exit(1);
  }
}

runMigration(); 